Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Austenem/CAT-246 dataset detail workspace updates #3533

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

austenem
Copy link
Collaborator

@austenem austenem commented Sep 5, 2024

Summary

Update menu choices for the workspace buttons in unified views dataset detail pages to allow for both creating and editing workspaces.

Design Documentation/Original Tickets

CAT-246 Jira ticket

CAT-507 Jira ticket (design)

Testing

Went through both options for both workspace buttons on several dataset pages.

Screenshots/Video

Screen.Recording.2024-09-05.at.12.29.05.PM.mov

Checklist

  • Code follows the project's coding standards
    • Lint checks pass locally
    • New CHANGELOG-your-feature-name-here.md is present in the root directory, describing the change(s) in full sentences.
  • Unit tests covering the new feature have been added
  • All existing tests pass
  • Any relevant documentation in JIRA/Confluence has been updated to reflect the new feature
  • Any new functionalities have appropriate analytics functionalities added

Copy link
Collaborator

@john-conroy john-conroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments for now. I'll definitely need @NickAkhmetov to take a look at this as he's much closer to the unified datasets work.

{
children: 'Add to Workspace',
onClick: trackAddToWorkspace,
icon: <AddRounded color="primary" />,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the fontSize prop here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a fontSize prop of any value to this icon shrinks it, not sure why - but the default size matches designs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icons directly imported from @mui/material/icons have a default fontSize of 1.25rem (medium): https://mui.com/material-ui/icons/#size

Icons we import from our icon map have their default font size set to 1rem by the default icon styles, so we end up needing to add the fontSize prop for those cases.

Comment on lines 75 to 81
// Clone the button element and add the onClick handler
const buttonWithClickHandler = React.cloneElement(button as React.ReactElement, {
onClick: handleClick,
'aria-controls': open ? 'basic-menu' : undefined,
'aria-haspopup': 'true',
'aria-expanded': open ? 'true' : undefined,
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we just pass these as props to a mui Button component?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the cases for this component involve very differently styled menu buttons, I opted to let that button be a fully customizable React node prop (screen caps below). This cloned element was an effort to add as many shared properties to that customized button as possible and avoid duplication.

Screenshot 2024-09-06 at 10 30 31 AM
Screenshot 2024-09-06 at 10 30 42 AM

Comment on lines 51 to 52
defaultName: hubmap_id,
initialSelectedDatasets: [uuid] ?? [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uuid and hubmap_id will always be the primary dataset since it comes from the flask data context. Doesn't the helper panel only appear for the current processed dataset in view?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - there is a zustand store that provides the current visible helper panel content.

Also, [uuid] is never nullish due to list wrapper; if we want to fall back to an empty array in this case, [uuid].filter(Boolean) should work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it- updated this to reflect the current processed dataset.

Copy link
Collaborator

@NickAkhmetov NickAkhmetov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The uuid mismatches are the main thing that concerns me since that's the same issue that led to the failing downloads regression.

Copy link
Collaborator

@john-conroy john-conroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Let's wait on @NickAkhmetov's review before merging.

Copy link
Collaborator

@NickAkhmetov NickAkhmetov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@austenem austenem merged commit 7100538 into main Sep 10, 2024
8 checks passed
@austenem austenem deleted the austenem/cat-246-dataset-detail-workspace-updates branch September 10, 2024 19:20
@austenem
Copy link
Collaborator Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants